package com.meijin.spring6.di_xml;

import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @Author meijindeng
 * @Data 2023-09-01 14:32
 * @Description 对象、数组、集合注入实体类
 * @Version 1.0
 */
@Data
public class BookAuthor {

    private String name;

    private Integer age;

    private Book book;

    private String[] friends;

    private List<Book> bookList;

    private Map<String, Book> bookMap;

    public BookAuthor() {
        System.out.println("BookAuthor的'无'参构造执行了！");
    }

    public BookAuthor(String name, Integer age) {
        System.out.println("BookAuthor的'有'参构造执行了！");
        this.name = name;
        this.age = age;
    }

    public void getBookAuthorInfo() {
        System.out.print("作者名字：" + name + "。书籍信息[");
        book.getBookInfo();
        System.out.println("]");
    }
}
